<?php
class ListAction extends Action {
    private $nav = null;
    private $goods = null;
    public function __construct() {
        parent::__construct();
        $this->nav = new NavModel();
        $this->goods = new GoodsModel();
    }
    public function index() {
        parent::page(15,$this->goods);
        $this->tpl->assign('listGoods',$this->goods->findListGoods());
        $this->tpl->assign('listBrand',$this->nav->findFrontBrand());
        $this->tpl->assign('FrontNav',$this->nav->showNav());
        $this->tpl->assign('listPrice',$this->nav->findListPrice());
        $this->tpl->assign('listAttr',$this->goods->findFrontAttr());
        $this->tpl->assign('url',Tool::getUrl());
        $this->tpl->assign('TenNav',$this->nav->findFrontTenNav());
        $this->tpl->assign('viewRecord',$this->goods->getViewRecord());
        $this->tpl->assign('hotGoods',$this->goods->findHotGoods());
        $this->tpl->display(SMARTY_FRONT.'public/list.html');
    }

    public function clearViewRecord() {
        $this->goods->clearViewRecord() ? $this->redirect->succ(Tool::getPrevPage()) : $this->redirect->error('系统出错，删除浏览记录失败!');
    }

}


?>